package cs340.stormtroopers.junitTests;

import java.util.ArrayList;
import java.util.HashMap;

import cs340.stormtroopers.hypeerweb.CompleteNodeDomain;
import cs340.stormtroopers.hypeerweb.HyPeerWebBuilder;
import cs340.stormtroopers.hypeerweb.Node;

import junit.framework.TestCase;

public class HyPeerWebBuilderTests extends TestCase
{
	public void testNumberOfNodesCreated()
	{

		ArrayList<CompleteNodeDomain> testset = new ArrayList<CompleteNodeDomain>();
		testset.add(new CompleteNodeDomain(0, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 7, -1, -1));
		testset.add(new CompleteNodeDomain(1, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 6, -1, -1));
		testset.add(new CompleteNodeDomain(2, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 5, -1, -1));
		testset.add(new CompleteNodeDomain(3, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 4, -1, -1));
		testset.add(new CompleteNodeDomain(4, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 3, -1, -1));
		testset.add(new CompleteNodeDomain(5, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 2, -1, -1));
		testset.add(new CompleteNodeDomain(6, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 1, -1, -1));
		testset.add(new CompleteNodeDomain(7, 8, new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(),
				new ArrayList<Integer>(), new ArrayList<Integer>(), 0, -1, -1));
		HyPeerWebBuilder test0 = new HyPeerWebBuilder(testset);

		HashMap<Integer, Node> testmap0 = test0.getNodeSet();
		assertTrue(testmap0.size() == 8);

	}
}
